import React, { Component } from 'react';
import { hashHistory } from 'react-router';
import CommentItem from 'common/components/commentItem.js';
import './bookComment.less';

class BookComment extends Component{

	gotoComment = () => {
//		hashHistory.push("/comment");
	}

	render(){
		const { bookComments } = this.props;

		return(
			<div>
				<div className="book_comment">
					<h1>评论</h1>
					{
						bookComments && bookComments.length > 0 &&
						bookComments.map((item, index) => {
							return(
								<CommentItem key={index} comment={item}></CommentItem>
							)
						})
					}
					{
						bookComments && bookComments.length == 0 &&
						<span className="nocomment">暂无评论</span>
					}
				</div>
				{/*
					bookComments && bookComments.length > 0 &&
					<div className="book_detail_comment_all" onClick={this.gotoComment}>
						查看全部271条评论
					</div>
				*/}
				
			</div>
		)
	}
}

export default BookComment;